<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>插入信息界面</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
  	<h1>添加界面</h1>
  	<c:if test="${entity=='Teacher'}">
  		<form action="<%=path%>/ActionServlet?entity=Teacher&method=insert" method="post">
    		教师编号：<input type="text" name="userId"><br>
    		教师姓名：<input type="text" name="userName"><br>
    		登陆密码：<input type="text" name="password"><br>
    		<input type="submit" value="确定">
    	</form>
    </c:if>
    <c:if test="${entity=='Student'}">
    	<form action="<%=path%>/ActionServlet?entity=Student&method=insert" method="post">
    		学生学号：<input type="text" name="userId"><br>
    		学生姓名：<input type="text" name="userName"><br>
    		学生性别：<input type="text" name="studentSex"><br>
    		学生密码: <input type="text" name="password"><br>
    		<input type="submit" value="保存">
    	</form>
    </c:if>
    <c:if test="${entity=='Class'}">
    	<form action="<%=path%>/ActionServlet?entity=Class&method=insert" method="post">
    		班级编号：<input type="text" name="userId"><br>
    		班级名称：<input type="text" name="userName"><br> 
    		<input type="submit" value="保存">
    	</form>
    </c:if>
    <c:if test="${entity=='Course'}">
    	<form action="<%=path%>/ActionServlet?entity=Course&method=insert" method="post">
    		课程编号：<input type="text" name="userId"><br>
    		课程名称：<input type="text" name="userName"><br> 
    		<input type="submit" value="保存">
    	</form>
    </c:if>
    <c:if test="${entity=='ClassOpen'}">
    	<form action="<%=path%>/ActionServlet?entity=ClassOpen&method=insert" method="post">
    		学生学号:
			<select name="studentId">
				<c:forEach items="${notChoseList}" var="stuId">
					<option value="${stuId}">${stuId}</option>
            	</c:forEach>
			</select>
			班级编号：
			<select name="classId">
				<c:forEach items="${classList}" var="classId">
					<option value="${classId}">${classId}</option>
            	</c:forEach>
			</select>
			课程编号：
			<select name="courseId">
				<c:forEach items="${courseList}" var="courseId">
					<option value="${courseId}">${courseId}</option>
            	</c:forEach>
			</select>
			教师编号：
			<select name="teacherId">
				<c:forEach items="${teacherList}" var="teacherId">
					<option value="${teacherId}">${teacherId}</option>
            	</c:forEach>
			</select>
			<input type="submit" value="保存选课信息">
		</form>
    </c:if>
  </body>
</html>
